<?php
    $syscontact = snmp2_get($machine->getAdresseIp(), $machine->getCommunity(), 'system.sysDescr.0');
    $pattern = "/Software:[^(]*/";
    $os = array();
    $o = "";
    preg_match($pattern, $syscontact, $os);
    foreach($os as $o) {
        $o = str_replace("Software: ", "", $o);
    }
    if(!empty($o)) {
        $criticite = Criticite::recherche(1);
        $message = $o;
    }
    else {
        $criticite = Criticite::recherche(2);
        $message = "Impossible de récupérer la version de l'OS";
    }
?>
